<?php
$subNav = array();

$arr = explode("/", $_SERVER['PHP_SELF']);

$domain = substr($_SERVER['PHP_SELF'], 0, strlen($arr[1]) + 1);

set_include_path("../");
include("inc/essentials.php");
?>
<script>
    $mainNav.set("home")
</script>
<div id="bdwrapper">
    <div id="leftcontent">
        <div class="backcontent"><a href="javascript:history.back()"><img src="img/icons/backicon.png" /><span>Đơn Hàng</span></a></div>
        <div class="contentnews">
            <div class="sky_left_section">
                <div style="padding:15px;">
                    <div style="color:#143B85; font-size:20px; font-weight:bold; margin-bottom:15px;">
                        Xem Thông Tin Đơn Hàng
                    </div>
                    <div style="color:#F00">
                    </div>
                    <form method="post" action="#!/url=donhang.php">
                        Nhập mã đơn hàng: <br>
                        <input name="orders_code" id="order_code" type="text">
                        <br>
                        <input type="button" id="xem" value="Xem" style="width:100px">
                    </form>	
                </div>
            </div>        
        </div>
    </div>
    <div id="rightcontent">
        <?php require_once 'tpl/ticket/menu_right.php'; ?>
    </div>
    <div class="clearAll"></div>
    <ul class="listservice">
        <li><a <?php metroLink("search.php") ?>><img src="img/banner/dat-ve.jpg" width="178" height="132" /></a></li>
        <li><a <?php metroLink("search.php") ?>><img src="img/banner/thue-xe.jpg" width="178" height="132" /></a></li>
        <li><a <?php metroLink("search.php") ?>><img src="img/banner/datphong.jpg" width="178" height="132" /></a></li>
        <li><a <?php metroLink("search.php") ?>><img src="img/banner/dulich.jpg" width="178" height="132" /></a></li>
        <li><a <?php metroLink("search.php") ?>><img src="img/banner/dichvu.jpg" width="178" height="132" /></a></li>
    </ul>
</div>

<div class="clear"></div>
<div class="webfooter">
    <div id="bdwrapper">
        <!--daily-->
        <div class="ctnfooter">
            <div class="title">Danh sách đại lý</div>
            <ul>
                <li><a href="#">Đại lý miền Bắc</a></li>
                <li><a href="#">Đại lý miền Trung</a></li>
                <li><a href="#">Đại lý miền Nam</a></li>
            </ul>
        </div>
        <!--tuvan-->
        <div class="ctnfooter">
            <div class="title bgtitle">Tư vấn & Hướng dẫn</div>
            <ul>
                <li><a href="#">Liên hệ</a></li>
                <li><a href="#">Hướng dẫn thanh toán</a></li>
                <li><a href="#">Thông tin chuyển khoản</a></li>
                <li><a href="#">Hướng dẫn đặt vé</a></li>
                <li><a href="#">Câu hỏi thường gặp</a></li>
                <li><a href="#">Chăm sóc khách hàng</a></li>
                <li><a href="#">Trang tư vấn</a></li>
            </ul>
        </div>
        <!--aboutus-->
        <div class="ctnfooter">
            <div class="title bgtitle">Về chúng tôi</div>
            <ul>
                <li><a href="#">Giới thiệu về SkyExpress</a></li>
                <li><a href="#">Các đơn vị hợp tác</a></li>
                <li><a href="#">Cơ hội hợp tác</a></li>
                <li><a href="#">Cấu trúc trang web</a></li>
                <li><a href="#">Tin tức</a></li>
            </ul>
        </div>
        <!--contact-->
        <div class="colcontact">
            <div class="phone mrgbtm">
                <div class="iconlist"><img src="img/icons/contactlist.png" /></div>
                <div class="infolist">
                    <div><span class="location">Toàn quốc</span><span>04.3533.3338</span></div>
                    <div><span class="location">Hà Nội</span><span>04.3533.3338</span></div>
                    <div><span class="location">Sài Gòn</span><span>04.3533.3338</span></div>
                </div>
            </div>
            <div class="clear"></div>
            <!--Chat-->
            <div class="iconlist mrgbtm"><img src="img/icons/chat.png" /><span>skyexpress</span></div>
            <div class="clear"></div>
            <!--mail-->
            <div class="iconlist mrgbtm"><img src="img/icons/mai1.png" /><span>Contact@skyexpress.vn</span></div>
            <div class="clear"></div>
        </div>
    </div>
    <div class="clear"></div>
    <div class="copyright">
        <div class="fl">© 1996-2013, skyexpress.vn</div>
        <div class="fl" style="margin-left:145px;"><a href="#">Đặt vé</a>  /   <a href="#">Đặt phòng</a>   /    <a href="#">Thuê xe</a>   /   <a href="#">Giới thiệu</a> / <a href="#">Quản lý</a></div>
        <div class="logobtm"><img src="img/icons/logobtm.png" /></div>
    </div>
    <div class="clear"></div>
</div>
<script>
    $('#xem').click(function() {
        $.ajax({
            // The link we are accessing.
            url: "<?php echo $domain ?>/ajax.php",
            // The type of request.
            type: "get",
            data: "act=cart&order_code=" + $('#order_code').val() ,
            // The type of data that is getting returned.
            dataType: "html",
            error: function() {
                // Load the content in to the page.
                $("#error").html("<label>Page Not Found!!</label>");
                $("#error").css({display: "block"});
            },
            success: function(strData) {
                // Load the content in to the page.
                if (strData == "1") {
                    window.location.href = '<?php echo $domain ?>/#!/url=donhang.php';
                } else {
                    alert(strData);
                }
            }
        });
    });
</script>